package com.example.cangzhou.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {

    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
            .info(new Info()
                .title("API文档")
                .version("1.0")
                .description("项目接口文档")
                .contact(new Contact().name("Your Name").url("http://localhost:8081").email("your-email@example.com")))
            .externalDocs(new ExternalDocumentation()
                .description("更多文档")
                .url("https://external-docs-url.com"));
    }
}